home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-25 | 3.4 KB | 100 lines | [TEXT/GEOL] |
- Item 0272738 21-June-90 07:07PDT
-
- From: CDA0220 DEV Bell Northern Resrch,B Papp,IDV
-
- To: APPLE.BUGS Apple Bugs Reporting
- MACAPP.TEST MacApp SQA Team
- MACAPP.TECH$ MacApp Technical
-
- Sub: MacApp 2.0 Bugs/Problems
-
- Hi,
-
- We have just converted a large MacApplication from 2.0b9 to 2.0.
- We started from the release notes and made appropriate changes. Overall, things
- went smoothly.These bugs and undocumented changes bit us:
-
- 1) MacApp source will not compile
-
- After applying the two patches listed in the release notes, we did a full
- MacApp build and discovered that UDialog would not compile with MPW 3.1. This
- definition must be added to TIcon.Draw:
-
- TYPE BitMapPtr = ^BitMap;
-
- Also, there are typos in the TView.Focus patch in the release notes: vh and vhs
- are reversed.
-
- 2) GetSameItemNo fails in debug if looking for NIL.
-
- With previous versions of MacApp, it was perfectly acceptable to check for a
- NIL object in a list. GetSameItemNo would return 0, as expected. With 2.0,
- there is an explicit check in debug mode that the object is valid so NIL
- doesn't work. We now end up coding:
-
- IF obj = NIL then
- index := 0
- ELSE
- index := GetSameItemNo(obj)
-
- 3) TCommand.TrackMouse bombs on mouse up if fView is NIL.
-
- Other parts of TCommand check that fView is non-nil before referencing it.
-
- The offending line is:
- IF (aTrackPhase = trackRelease) & (NOT fView.ContainsMouse(nextPoint)) THEN
- which we changed to:
- IF (aTrackPhase = trackRelease) & (fView <> NIL) & (NOT
- fView.ContainsMouse(nextPoint)) THEN
-
- 4) TPopup.DrawPopupBox can loop endlessly and trash memory.
-
- When drawing the popup box, MacApp 2.0 checks that the text will fit and if
- not, removes characters and appends a trailing ellipses until it will fit. The
- problem which we encountered occurs with a dynamic menu which initially has no
- entries.
-
- DrawPopupBox tries to render an empty string, as it should. When it calculates
- the size it needs, it gets 0 and notices that this won't fit in the box which
- it calculates as having a negative width, due to the slop values.
-
- The code that removes trailing characters is:
- newLen := Length(theItem);
- REPEAT
- theItem[newLen] := '…';
- theItem[0] := CHR(newLen);
- newWid := StringWidth(theItem);
- newLen := PRED(newLen);
- UNTIL (newWid <= wid) | (newLen = 0);
-
- When newLen is 0, this delightful loop fills memory with ellipses, working
- backwards from the length byte of theItem. Eventually, the application heap is
- sufficiently trashed to cause an exception.
-
- We added this line before the repeat:
- IF newLen > 0 THEN
-
- 5) Rendering of StaticText has changed so that underlying area is not erased.
-
- MacApp 2.0b9 erased area under text before drawing. We relied on this when
- adding a second label to a cluster border. We now use a descendant of
- TStaticText with this override:
-
- PROCEDURE TEraseUnderStaticText.ImageText(text: Ptr; Length: LONGINT; box:
- Rect; just: INTEGER); OVERRIDE;
-
- BEGIN
- MATextBox(text, Length, box, just, fAutoWrap, NIL, kEraseFirst,
- kSpaceForCaret);
- END;
-
- 6) TPopup no longer calls DoChoice if the same item is re-selected.
-
- This broke part of our application which uses a descendant of TPopup for
- pull-down menus. Fix was to set fCurrentItem to 0 after DoChoice.
-
- Regards,
- Gordon Eastman
- Bell-Northern Research
-
-